package com.zejson.controller;


import com.zejson.dao.inf.UserMapper;
import com.zejson.entity.User;
import com.zejson.entity.UserExample;
import org.apache.ibatis.session.SqlSession;
import com.zejson.util.Mybatis3Utils;

import java.util.List;

public class MybatisTest {

	public static void main(String[] args) {

		SqlSession sqlSession = Mybatis3Utils.getSqlSession();

		UserMapper userMapper = sqlSession.getMapper(UserMapper.class);

		UserExample userExample = new UserExample();
		UserExample.Criteria criteria = userExample.createCriteria();
		criteria.andAccountIsNotNull();

		List<User> users = userMapper.selectByExample(userExample);

		for(User user1 : users) {
			System.out.println(user1);
		}

	}
}
